home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 356 / defs / inout.def < prev    next >
Text File  |  1992-03-11  |  3KB  |  100 lines

  1. DEFINITION MODULE InOut;   (*$T- N.Wirth 27.2.80*)
  2.     (*    modified by Philip E. Rosine 
  3.         17 nov 83
  4.  
  5.         modification was done to make this module
  6.         compatible with the definition for InOut
  7.         given in [Wirth,1983].        *)
  8.  
  9. (*        History of modifcation                       *)
  10. (*                                       *)
  11. (*        Who       Date        Why                   *)
  12. (*         K.Y. Tan.  6/18/85    To work with DBROS library       *)
  13. (*        Morris       9/19/86    Add termCH, make EOL a constant    *)
  14. (*        Morris       9/19/86    Make Read and ReadString work      
  15.                         N. Wirth book               *)
  16. (*        Morris    10/3/86    Change Open(Input,Output) to take 
  17.                     extention file name *)
  18.     
  19. (*
  20. *    Copyright (c) 1985, 1986 by
  21. *    Djavaheri Bros., Foster City, California.
  22. *    All Rights Reserved.
  23. *
  24. *    This software is furnished under a license and may be used and copied
  25. *    only  in accordance with  the  terms  of  such  license and  with the
  26. *    inclusion of the above copyright notice.  This software or  any other
  27. *    copies thereof may not be provided or otherwise made available to any
  28. *    other  person.   No title to and ownership of the  software is  herby
  29. *    transferred.
  30. *
  31. *    The information in this software is  subject to change without notice
  32. *    and  should  not be construed as a commitment by Djavaheri Bros.   No
  33. *    warranty is implied or expressed.
  34. *
  35. *    SCCID  = "1.2    10/8/86"; 
  36. *)
  37.   FROM Files IMPORT  File;
  38.   FROM SYSTEMX IMPORT EofLineChar;
  39.  
  40.   EXPORT QUALIFIED
  41.       OpenInput,   OpenOutput,   CloseInput,   CloseOutput,   Read,
  42.         ReadLn,      ReadString,   ReadInt,      ReadCard,      Write,         
  43.     WriteLn,     WriteString,  WriteInt,     WriteCard,     WriteOct,      
  44.     WriteHex,    EOL,          EOF,          Done, termCH, 
  45.     STDInput,STDOutput;
  46.  
  47.   CONST
  48.     EOL = EofLineChar;
  49.  
  50.   VAR 
  51.   Done : BOOLEAN;
  52.   termCH : CHAR;
  53.   STDInput , STDOutput : File;
  54.  
  55.   PROCEDURE OpenInput(VAR defext : ARRAY OF CHAR);
  56.      (* this routine is the same as the routine SetInput of
  57.        module StandIO, which sets the standrad input file as
  58.        specified  by defext name after is opened   *)
  59.  
  60.   PROCEDURE OpenOutput(VAR defext : ARRAY OF CHAR);
  61.      (* this routine is the same as the routine SetOutput of
  62.        module StandIO, which sets the standrad output file as
  63.        specified by  defext name after is opened *)
  64.  
  65.   PROCEDURE CloseInput;
  66.     (* closes input file;  returns input to terminal *)
  67.     
  68.   PROCEDURE CloseOutput;
  69.     (* closes output file;  returns output to terminal *)
  70.  
  71.   PROCEDURE Read(VAR ch: CHAR);
  72.  
  73.   PROCEDURE ReadLn;
  74.  
  75.   PROCEDURE ReadString(VAR s:ARRAY OF CHAR);
  76.  
  77.   PROCEDURE ReadInt(VAR x: INTEGER);
  78.  
  79.   PROCEDURE ReadCard(VAR x: CARDINAL);
  80.  
  81.   PROCEDURE Write(ch: CHAR);
  82.  
  83.   PROCEDURE WriteLn;
  84.  
  85.   PROCEDURE WriteString(VAR s: ARRAY OF CHAR);
  86.  
  87.   PROCEDURE WriteInt(x,n: INTEGER);
  88.  
  89.   PROCEDURE WriteCard(x, n: CARDINAL);
  90.  
  91.   PROCEDURE WriteOct(w, n: CARDINAL); 
  92.  
  93.   PROCEDURE WriteHex(w, n: CARDINAL);
  94.  
  95.  
  96.   PROCEDURE EOF () : BOOLEAN;
  97.      (* check End_Of_File *)
  98.  
  99. END InOut.
  100.